<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;" />
<script src="base64.min.js"></script>

<title>Untitled Document</title>
<script>
var Gbridge;

function connectWebViewJavascriptBridge(callback) {
	if (window.WebViewJavascriptBridge) {
		callback(WebViewJavascriptBridge);
	} else {
		document.addEventListener('WebViewJavascriptBridgeReady', function() {
			callback(WebViewJavascriptBridge);
		}, false)
	}
}

connectWebViewJavascriptBridge(function(bridge) {
	Gbridge=bridge;
});

function buyGoods(){
	var param={"productId":"123"};
	
	//param=Base64.encode(JSON.stringify(param));
	
	Gbridge.callHandler('clickReservationsNow',param,function(response) {});
}

</script>

</head>

<body>

<p>
	<input type="button" value="预定商品" onClick="buyGoods()" />
</p>

</body>
</html>
